/**
 *  用户登录
 */
$(function(){
	$('.loginBtn').click(function(){
		var loginName = $("input[name='username']").val();
		if (loginName.length <= 0) {
				$("input[name='username']").attr("placeholder", "请输入帐号");
				return false;
		}
		
		var password = $("input[name='password']").val();
		if (password.length <= 0) {
			$("input[name='password']").attr("placeholder", "请输入密码");
			return false;
		}
		
		$.ajax({
			url: baselocation + '/loginAction',
			type: 'post',
			dataType : 'json',
			data:{
				"loginName" : loginName,
				"loginPassword" : password,
			},
			success : function(result){
				
				console.info(result);
				window.location.href = baselocation + '/home';
			}
		});
		
	});
	
});